import http from "@/utils/http2.js";
/**
 * 查询菜单列表
 */
export function query(data) {
  return http.get("/api/permissions/menu/tree", {});
}

/**
 * 查询上级菜单树
 * @param data
 * @returns {*}
 */
export function queryTree(data){
  return http.get("/api/permissions/on/tree",{})
}

/**
 * 新增菜单
 * @param data
 * @returns {*}
 */
export function save(data) {
  return http.post("/api/permissions/menu/insert", data);
}

/**
 * 根据菜单id修改菜单状态
 * @param data
 * @returns {*}
 */
export function editStatus(data){
  return http.put("/api/permissions/edit/status",data)
}

/**
 * 根据菜单id修改菜单是否显示
 * @param data
 * @returns {*}
 */
export function editShowLink(data){
  return http.put("/api/permissions/edit/showLink",data)
}

/**
 * 编辑菜单
 * @param data
 * @returns {*}
 */
export function editMenu(data){
  return http.put("/api/permissions/edit",data)
}
export function deleteById(id){
  return http.get("/api/permissions/delete?id="+id,{})
}
